Skip to content

Report the guard band's actual depth - #13

Merged
ps2 merged 1 commit into
mainfrom
fix/guard-band-actual-depth
Oct 25, 2026
Merged

ps2 merged 1 commit into
mainfrom
fix/guard-band-actual-depth

Conversation

@ps2

@ps2 ps2 commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #12.

GuardAndRunwayOutput.bandDepth reported the band's depth at 60 min. Loop leaves out forecast points where nothing changes, so a forecast can have no point near 60 min. A flat forecast with no insulin or carb effects has points only out to about 56 min and then jumps to the end. In the simulator, a forecast like that was lowered about 2 mg/dL while bandDepth said 12.

bandDepth is now the most the band actually lowered any point of the forecast. The test now checks it equals the largest difference between the standard and guarded forecasts. swift test passes (179).

Loop leaves out forecast points where nothing changes, so a forecast may have no
point near 60 min, where the band is deepest. bandDepth is now the most the band
lowered any point of the forecast, not the band's depth at 60 min.
@ps2
ps2 merged commit 3e5c268 into main Oct 25, 2026
Trpl7ca pushed a commit to Trpl7ca/LoopWorkspace that referenced this pull request Oct 25, 2026
- LoopKit/LoopAlgorithm#12: AlgorithmOutput.guardAndRunway
- LoopKit/LoopAlgorithm#13: Report the guard band's actual depth
- LoopKit/Loop#2611: Show and record what Guard + Runway did
@ps2
ps2 deleted the fix/guard-band-actual-depth branch November 1, 2026 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant